#include <assert.h>
#include <ctype.h>
#include <locale.h>
#include <errno.h>
#include <float.h>
#include <limits.h>
#include <math.h>
#include <setjmp.h>
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>


void know_length(void)
{
    printf("***** know_length *****\n");
    char * string = "hello world"; /* This 11 chars long, excluding the 0-terminator. */
    size_t i = 0;
    for (; i < 11; i++) {
        printf("%c\n", string[i]); /* Print each character of the string. */
    }
}



void unknow_length(void)
{
    printf("***** unknow_length *****\n");
    char * string = "hello world";
    size_t length = strlen(string);
    size_t i = 0;
    for (; i < length; i++) {
        printf("%c\n", string[i]); /* Print each character of the string. */
    }
}


void null_character(void)
{
    printf("***** null_character *****\n");
    char * string = "hello world";
    size_t i = 0;
    while (string[i] != '\0') { /* Stop looping when we reach the null-character. */
        printf("%c\n", string[i]); /* Print each character of the string. */
        i++;
    }
}


void main(void)
{
    know_length();
    unknow_length();
    null_character();
    system("pause");
}